package cn.iocoder.yudao.module.team.dal.mysql.orde;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.team.dal.dataobject.orde.OrdeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.team.controller.admin.orde.vo.*;

/**
 * 团队订单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrdeMapper extends BaseMapperX<OrdeDO> {

    default PageResult<OrdeDO> selectPage(OrdePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrdeDO>()
                .eqIfPresent(OrdeDO::getNumbers, reqVO.getNumbers())
                .eqIfPresent(OrdeDO::getLineNames, reqVO.getLineNames())
                .eqIfPresent(OrdeDO::getLineId, reqVO.getLineId())
                .eqIfPresent(OrdeDO::getType, reqVO.getType())
                .likeIfPresent(OrdeDO::getBlocksName, reqVO.getBlocksName())
                .betweenIfPresent(OrdeDO::getArriveDate, reqVO.getArriveDate())
                .betweenIfPresent(OrdeDO::getArriveTime, reqVO.getArriveTime())
                .betweenIfPresent(OrdeDO::getReturnDate, reqVO.getReturnDate())
                .betweenIfPresent(OrdeDO::getReturnTime, reqVO.getReturnTime())
                .orderByDesc(OrdeDO::getId));
    }

}